package com.example.zhilongzhang.constructionpayapp.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.example.zhilongzhang.constructionpayapp.R;
import com.example.zhilongzhang.constructionpayapp.base.BaseActivity;
import com.example.zhilongzhang.constructionpayapp.bean.GlobleBean;
import com.example.zhilongzhang.constructionpayapp.bean.UserInfoBean;
import com.example.zhilongzhang.constructionpayapp.http.HttpMethod;
import com.example.zhilongzhang.constructionpayapp.util.SpUtil;
import com.google.gson.Gson;
import com.squareup.okhttp.Request;
import com.zhy.http.okhttp.callback.StringCallback;


public class UserInfoActivity extends BaseActivity implements View.OnClickListener{

    public static final int CODE_ID = 0;
    public static final int CODE_NAME = 1;
    public static final int CODE_TEL = 2;

    ImageView ivBack;
    RelativeLayout rlId;
    TextView tvId;
    RelativeLayout rlTel;
    TextView tvTel;
    RelativeLayout rlName;
    TextView tvName;

    private int mRequestCode;
    TextView tvUserName,tvUserId;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_userinfo);
        tvUserName=findViewById(R.id.tv_user_name);
        tvUserId=findViewById(R.id.tv_user_id);
        ivBack = findViewById(R.id.left);
        rlId = findViewById(R.id.rl_id);
        tvId = findViewById(R.id.tv_id);
        rlTel = findViewById(R.id.rl_tel);
        tvTel = findViewById(R.id.tv_tel);
        rlName = findViewById(R.id.rl_name);
        tvName = findViewById(R.id.tv_name);
        tvUserName.setText(SpUtil.getUserName());
        tvUserId.setText(SpUtil.getUserId());
        tvId.setText(SpUtil.getShopId());
        tvName.setText(SpUtil.getShopName());
        tvTel.setText(SpUtil.getTel());

        ivBack.setOnClickListener(this);
//        rlId.setOnClickListener(this);
//        rlTel.setOnClickListener(this);
//        rlName.setOnClickListener(this);

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.left:
                finish();
                break;
//            case R.id.rl_id:
//                String id = tvId.getText().toString();
//                Intent intent = new Intent(UserInfoActivity.this, ChangeInfoActivity.class);
//                intent.putExtra("title", "修改商户ID");
//                intent.putExtra("content", id);
//                intent.putExtra("type", CODE_NAME);
//                startActivityForResult(intent, CODE_NAME);
//                break;
//            case R.id.rl_tel:
//                String tel = tvTel.getText().toString();
//                Intent intent2 = new Intent(UserInfoActivity.this, ChangeInfoActivity.class);
//                intent2.putExtra("title", "修改电话");
//                intent2.putExtra("content", tel);
//                intent2.putExtra("type", CODE_TEL);
//                startActivityForResult(intent2, CODE_TEL);
//                break;
//            case R.id.rl_name:
//                String name = tvTel.getText().toString();
//                Intent intent3 = new Intent(UserInfoActivity.this, ChangeInfoActivity.class);
//                intent3.putExtra("title", "修改商户名称");
//                intent3.putExtra("content", name);
//                intent3.putExtra("type", CODE_TEL);
//                startActivityForResult(intent3, CODE_TEL);
//                break;
        }
    }
}
